var mongoose = require("mongoose");
mongoose.Promise = global.Promise;
mongoose.set('useCreateIndex', true) 
mongoose.connect("mongodb://127.0.0.1:27017/test_user",{ useNewUrlParser: true });
var cn = mongoose.connection;
cn.on("open",function(){
    console.log("数据库连接成功");
});
cn.on("error",function(){
    console.log("数据库连接失败");
});
module.exports = mongoose;